# -*- coding: utf-8 -*-

from services import *


class WeixinService():

	def addText(self,txtDict):
		sql = 'insert into wx_text(`%s`) values ("%s")' % ('`,`'.join(txtDict.keys()),'","'.join(txtDict.values()))
		dbManager.executeNonQuery(sql)

	def addImage(self,imageDict):
		sql = 'insert into wx_image(`%s`) values ("%s")' % ('`,`'.join(imageDict.keys()),'","'.join(imageDict.values()))
		dbManager.executeNonQuery(sql)

	def addVoice(self,voiceDict):
		sql = 'insert into wx_voice(`%s`) values ("%s")' % ('`,`'.join(voiceDict.keys()),'","'.join(voiceDict.values()))
		dbManager.executeNonQuery(sql)

	def addVideo(self,videoDict):
		sql = 'insert into wx_video(`%s`) values ("%s")' % ('`,`'.join(videoDict.keys()),'","'.join(videoDict.values()))
		dbManager.executeNonQuery(sql)

	def addLocation(self,locDict):
		sql = 'insert into wx_location(`%s`) values ("%s")' % ('`,`'.join(locDict.keys()),'","'.join(locDict.values()))
		dbManager.executeNonQuery(sql)

	def addMsgLocation(self,msgLocDict):
		sql = 'insert into wx_msg_location(`%s`) values ("%s")' % ('`,`'.join(msgLocDict.keys()),'","'.join(msgLocDict.values()))
		
		dbManager.executeNonQuery(sql)

	def addLink(self,linkDict):
		sql = 'insert into wx_link(`%s`) values ("%s")' % ('`,`'.join(linkDict.keys()),'","'.join(linkDict.values()))
		dbManager.executeNonQuery(sql)